{% extends "base_generic.html" %}

{% block content %}
    <h1>All blogs</h1>

    {% if blog_list %}
    <ul>

      {% for blog in blog_list %}
      <li>
        <a href="{{ blog.get_absolute_url }}">{{ blog.name }}</a> ({{blog.post_date}}) — <a href="{% url 'blogs-by-author' blog.author.pk %}">{{ blog.author }}</a>
      </li>
      {% endfor %}

    </ul>

    {% else %}
      <p>There are no blogs.</p>
    {% endif %}       
{% endblock %}

